package edu.mit.compilers.assembly.x64.codes;

public class X64FlagCode extends X64Code {
    public static final X64FlagCode GLOBAL_MAIN = new X64FlagCode(".globl main", true);
    public static final X64FlagCode DATA_SEC = new X64FlagCode(".data", false);
    public static final X64FlagCode TEXT_SEC = new X64FlagCode(".text", false);

    public static final X64FlagCode LEAVE_CODE = new X64FlagCode("leave", true);
    public static final X64FlagCode RET_CODE = new X64FlagCode("ret", true);

    private String content;
    private boolean needPrefix;

    public X64FlagCode(String content, boolean needPrefix) {
        this.content = content;
        this.needPrefix = needPrefix;
    }

    @Override
    protected String getStringFroShow(String prefix, boolean debug) {
        return (needPrefix ? prefix : "") + content + "\n";
    }
}
